package auction.model;

import hello.Address;

import java.util.HashSet;
import java.util.Set;

import auction.chapter05.model.BillingDetails;

public class User{
	private Long id;
	private String name;
	private Address shippingAddress;
	private Set<Bid> bids=new HashSet<Bid>();
	
	private BillingDetails defaultBillingDetails;
	private Set<BillingDetails> billingDetails=new HashSet<BillingDetails>();
	
	public User(){
	}
	
	public User(String name){
		this.name=name;
	}
	
	
	
	public Long getId(){
		return id;
	}
	public void setId(Long i){
		id=i;
	}
	
	public void setBids(Set<Bid> i){
		bids=i;
	}
	public Set<Bid> getBids(){
		return bids;
	}
	/* GOOD!!! */
	public void addBid(Bid bid){
		bid.setBidder(this);
		bids.add(bid);
	}
	
	public String getName(){
		return name;
	}
	public void setName(String i){
		name=i;
	}
	
	public Address getShippingAddress(){
		return shippingAddress;
	}
	public void setShippingAddress(Address i){
		shippingAddress=i;
	}

	public BillingDetails getDefaultBillingDetails() {
		return defaultBillingDetails;
	}

	public void setDefaultBillingDetails(BillingDetails defaultBillingDetails) {
		this.defaultBillingDetails = defaultBillingDetails;
	}

	public Set<BillingDetails> getBillingDetails() {
		return billingDetails;
	}

	public void setBillingDetails(Set<BillingDetails> billingDetails) {
		this.billingDetails = billingDetails;
	}
	
	public void addBillingDetails(BillingDetails in){
		this.billingDetails.add(in);
		in.setUser(this);
	}
}